package com.mazaiting.mybatisplus.encrypt.encryptor;

import org.jasypt.util.text.TextEncryptor;

/**
 * 加密处理器
 *
 * @author danghailiang
 */
public class BasicTextEncryptor extends CachedTextEncryptor {

    @Override
    protected TextEncryptor createTextEncryptor(String key) {
        // 获取加密器
        org.jasypt.util.text.BasicTextEncryptor encryptor = new org.jasypt.util.text.BasicTextEncryptor();
        // 设置Key
        encryptor.setPassword(key);
        // 返回加密器
        return encryptor;
    }
}
